package com.mayuanfei.springaop.service.impl;

import com.mayuanfei.springaop.dao.DeptMapper;
import com.mayuanfei.springaop.service.DeptService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 部门服务实现类
 *
 * @author 老马
 * @date 2023-03-01 13:12
 */
@Service
@AllArgsConstructor
public class DeptServiceImpl implements DeptService {

    private final DeptMapper deptMapper;

    /**
     * 添加部门
     *
     * @param deptId   部门id
     * @param deptName 部门名称
     * @return 部门id
     */
    public int addDept(int deptId, String deptName) {
        int retDeptId = this.deptMapper.insertDept(deptId, deptName);
        retDeptId = retDeptId / 0;
        return retDeptId;
    }
}